﻿@*
    TicketDesk - Attribution notice
    Contributor(s):

         Stephen Redd (stephen@reddnet.net, http://www.reddnet.net)

    This file is distributed under the terms of the Microsoft Public
    License (Ms-PL). See http://opensource.org/licenses/MS-PL
    for the complete terms of use.

    For any distribution that contains code from this file, this notice of
    attribution must remain intact, and a copy of the license must be
    provided to the recipient.
*@
@using TicketDesk.Domain
@using TicketDesk.Domain.Model
@model Ticket

<div class="panel-heading" style="padding: 3px 5px;">
    <div class="row">
        <div class="row-same-height row-full-height">
            <div class="col-xs-2 col-sm-2 col-xs-height col-full-height text-center panel-title" style="border-right: 1px solid #dcdcdc;">
                @Model.TicketStatus.GetDescription()
            </div>
            <div class="col-xs-2 col-sm-1 col-xs-height col-full-height text-center panel-title" style="border-right: 1px solid #dcdcdc;">
                #@Model.TicketId
            </div>
            <div class="col-xs-7 col-sm-9 col-xs-height col-full-height panel-title">
                @Model.Title
            </div>
            <div class="col-xs-1 col-xs-height col-full-height">
                <div class="pull-right">
                    <button id="watch" type="button" class="btn btn-default"
                            data-toggle="tooltip"
                            data-placement="bottom"
                            title="">
                        <i class="fa fa-eye"></i> <span class="hidden-sm hidden-xs"></span>
                    </button>
                </div>
            </div>

        </div>
    </div>

</div>
<div class="panel-body" style="padding-top: 0; padding-bottom: 0;">
    <div class="row row-no-padding row-same-height row-full-height">
        <div class="col-md-8 col-sm-8 col-xs-12 col-xs-height col-full-height ">
            <div class="container-fluid" style="padding: 0;">
                <div class="col-xs-12" style="border-bottom: 1px solid #B3CBDF; padding: 5px; background-color: #F7F7F7;">
                    <div class="pull-right">
                        @if (ViewBag.DisplayProjects ?? false)
                        {
                            <div class="text-primary">
                                <i class="fa fa-book"></i>
                                @Model.Project.ProjectName
                            </div>
                        }
                        @if (!string.IsNullOrEmpty(Model.TagList))
                        {
                            <div class="text-muted text-default">

                                @foreach (var tag in Model.TagList.Split(','))
                                {
                                    <div><i class="fa fa-tag"></i> @tag</div>
                                }
                            </div>
                        }


                    </div>
                    <div>
                        <div>@Model.Priority Priority @Model.Category @Model.TicketType</div>

                        <div>
                            Assigned To:
                            @if (string.IsNullOrEmpty(Model.AssignedTo))
                            {
                                <span class='label label-warning'>Unassigned</span>
                            }
                            else
                            {
                                @Model.GetAssignedToInfo().DisplayName
                            }
                        </div>
                        <div>
                            Owned By:
                            @Model.GetOwnerInfo().DisplayName

                        </div>
                        <div class="hidden-sm hidden-md hidden-lg">
                            Updated by @Model.GetLastUpdatedByInfo().DisplayName at @Model.LastUpdateDate.DateTime.ToShortDateString() @Model.LastUpdateDate.DateTime.ToShortTimeString()
                        </div>
                    </div>
                </div>
            </div>
            <div class="" style="margin: 0; padding: 0;">
                <div class="" id="detailsText" style="height: 200px; overflow: auto; margin: 0; padding: 5px;">
                    @Model.HtmlDetails()
                </div>
                <div id="detailTextExpander" class="expanderButton" style="height: 20px; display: none;">
                    <i id="expandersymbol" class="fa fa-chevron-down text-center"></i>
                </div>
            </div>
        </div>
        <div class="col-md-4 col-sm-4 hidden-xs col-sm-height col-full-height col-top" style="border-left: 1px solid #B3CBDF;background-color: #F7F7F7;">
            <aside class="small">
                <div style="padding: 5px;">
                    <div class="row">
                        @Html.LabelFor(m => m.TicketStatus, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.TicketStatus.GetDescription()
                        </div>
                    </div>
                    <div class="row">
                        @Html.LabelFor(m => m.LastUpdateBy, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.GetLastUpdatedByInfo().DisplayName
                        </div>
                    </div>
                    <div class="row">
                        @Html.LabelFor(m => m.LastUpdateDate, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.LastUpdateDate.DateTime.ToShortDateString() @Model.LastUpdateDate.DateTime.ToShortTimeString()
                        </div>
                    </div>

                    <div class="row">
                        @Html.LabelFor(m => m.CurrentStatusSetBy, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.GetCurrentStatusSetByInfo().DisplayName
                        </div>
                    </div>
                    <div class="row">
                        @Html.LabelFor(m => m.CurrentStatusDate, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.CurrentStatusDate.DateTime.ToShortDateString() @Model.CurrentStatusDate.DateTime.ToShortTimeString()
                        </div>
                    </div>
                    <div class="row">
                        @Html.LabelFor(m => m.CreatedBy, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.GetCreatedByInfo().DisplayName
                        </div>
                    </div>
                    <div class="row">
                        @Html.LabelFor(m => m.CreatedDate, new { @class = "col-sm-5 col-lg-4 text-right" })
                        <div class="col-sm-7 col-lg-8">
                            @Model.CreatedDate.DateTime.ToShortDateString() @Model.CreatedDate.DateTime.ToShortTimeString()
                        </div>
                    </div>

                    <div class="row">
                        <label class="col-sm-5 col-lg-4 text-right">Subscribers</label>
                        <div class="col-sm-7 col-lg-8">

                            @foreach (var sub in Model.TicketSubscribers)
                            {
                                <div>@sub.GetSubscriberDisplayInfo().DisplayName</div>
                            }
                        </div>
                    </div>
                </div>

            </aside>
        </div>
    </div>


</div>
